import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * User: 12629
 * Date: 2021/10/18
 * Time: 9:01
 * Description:
 */
public class TestDemo {

    public static void func1() {
        ///System.out.println("fsafasa");
    }

    public static void func2(int a,int b) {
        //System.out.println(a+" "+b);
        a = 20;
    }

    public static void func3(int[] array) {
        array = new int[]{1,2,3,4};
    }

    public static void func4(int[] array) {
        array[0] = 888;
    }

    public static int[] func5(int[] array) {
        array[0] = 888;
        return array;
    }

    /**
     * 数组转换为字符串
     * @param array
     * @return
     */
    public static String myToString(int[] array) {
        String ret = "[";
        for (int i = 0; i < array.length; i++) {
            ret = ret + array[i];
            if(i != array.length-1) {
                ret += ",";
            }
        }
        ret += "]";
        //System.out.println("hhhh" + ret);
        return ret;
    }

    public static int add(int a,int b) {
        return a+b;
    }

    public static void add2(int a,int b) {
        System.out.println(a+b);
    }

    public static void main(String[] args) {
        System.out.println(add(1,2)*6);
    }


    public static void main3(String[] args) {
        int[] array = {1,2,3,4,5,6,7,8,9};
        String s = myToString(array);
        System.out.println(s);
    }

    public static void main2(String[] args) {
        int[] array = {1,2,3,4,5,6,7,8,9};
        int[] ret = func5(array);
        System.out.println(Arrays.toString(ret));



    }

    public static void main1(String[] args) {
        int a = 10;
        int b = 20;
        func2(a,b);
        System.out.println(a);
    }

}
